home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / IntlResources.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  12.5 KB  |  332 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        IntlResources.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT IntlResources;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __INTLRESOURCES__}
  27. {$SETC __INTLRESOURCES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC IntlResourcesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43. CONST
  44. { Bits in the itlcFlags byte }
  45.     itlcShowIcon                = 7;                            {Show icon even if only one script}
  46.     itlcDualCaret                = 6;                            {Use dual caret for mixed direction text}
  47. { Bits in the itlcSysFlags word }
  48.     itlcSysDirection            = 15;                            {System direction - left to right/right to left}
  49. { the NumberParts indices }
  50.     tokLeftQuote                = 1;
  51.     tokRightQuote                = 2;
  52.     tokLeadPlacer                = 3;
  53.     tokLeader                    = 4;
  54.     tokNonLeader                = 5;
  55.     tokZeroLead                    = 6;
  56.     tokPercent                    = 7;
  57.     tokPlusSign                    = 8;
  58.     tokMinusSign                = 9;
  59.     tokThousands                = 10;
  60.     tokSeparator                = 12;                            {11 is a reserved field}
  61.     tokEscape                    = 13;
  62.     tokDecPoint                    = 14;
  63.     tokEPlus                    = 15;
  64.     tokEMinus                    = 16;
  65.     tokMaxSymbols                = 31;
  66.     curNumberPartsVersion        = 1;                            {current version of NumberParts record}
  67.  
  68.     currSymLead                    = 16;
  69.     currNegSym                    = 32;
  70.     currTrailingZ                = 64;
  71.     currLeadingZ                = 128;
  72.  
  73.     mdy                            = 0;
  74.     dmy                            = 1;
  75.     ymd                            = 2;
  76.     myd                            = 3;
  77.     dym                            = 4;
  78.     ydm                            = 5;
  79.  
  80.     
  81. TYPE
  82.     DateOrders = SInt8;
  83.  
  84.  
  85. CONST
  86.     timeCycle24                    = 0;                            {time sequence 0:00 - 23:59}
  87.     timeCycleZero                = 1;                            {time sequence 0:00-11:59, 0:00 - 11:59}
  88.     timeCycle12                    = 255;                            {time sequence 12:00 - 11:59, 12:00 - 11:59}
  89.     zeroCycle                    = 1;                            {old name for timeCycleZero}
  90.     longDay                        = 0;                            {day of the month}
  91.     longWeek                    = 1;                            {day of the week}
  92.     longMonth                    = 2;                            {month of the year}
  93.     longYear                    = 3;                            {year}
  94.     supDay                        = 1;                            {suppress day of month}
  95.     supWeek                        = 2;                            {suppress day of week}
  96.     supMonth                    = 4;                            {suppress month}
  97.     supYear                        = 8;                            {suppress year}
  98.     dayLdingZ                    = 32;
  99.     mntLdingZ                    = 64;
  100.     century                        = 128;
  101.     secLeadingZ                    = 32;
  102.     minLeadingZ                    = 64;
  103.     hrLeadingZ                    = 128;
  104.  
  105. { move OffsetTable to QuickdrawText }
  106.  
  107. TYPE
  108.     Intl0Rec = PACKED RECORD
  109.         decimalPt:                CHAR;                                    {decimal point character}
  110.         thousSep:                CHAR;                                    {thousands separator character}
  111.         listSep:                CHAR;                                    {list separator character}
  112.         currSym1:                CHAR;                                    {currency symbol}
  113.         currSym2:                CHAR;
  114.         currSym3:                CHAR;
  115.         currFmt:                UInt8;                                    {currency format flags}
  116.         dateOrder:                UInt8;                                    {order of short date elements: mdy, dmy, etc.}
  117.         shrtDateFmt:            UInt8;                                    {format flags for each short date element}
  118.         dateSep:                CHAR;                                    {date separator character}
  119.         timeCycle:                UInt8;                                    {specifies time cycle: 0..23, 1..12, or 0..11}
  120.         timeFmt:                UInt8;                                    {format flags for each time element}
  121.         mornStr:                PACKED ARRAY [0..3] OF CHAR;            {trailing string for AM if 12-hour cycle}
  122.         eveStr:                    PACKED ARRAY [0..3] OF CHAR;            {trailing string for PM if 12-hour cycle}
  123.         timeSep:                CHAR;                                    {time separator character}
  124.         time1Suff:                CHAR;                                    {trailing string for AM if 24-hour cycle}
  125.         time2Suff:                CHAR;
  126.         time3Suff:                CHAR;
  127.         time4Suff:                CHAR;
  128.         time5Suff:                CHAR;                                    {trailing string for PM if 24-hour cycle}
  129.         time6Suff:                CHAR;
  130.         time7Suff:                CHAR;
  131.         time8Suff:                CHAR;
  132.         metricSys:                UInt8;                                    {255 if metric, 0 if inches etc.}
  133.         intl0Vers:                INTEGER;                                {region code (hi byte) and version (lo byte)}
  134.     END;
  135.     Intl0Ptr = ^Intl0Rec;
  136.     Intl0Hndl = ^Intl0Ptr;
  137.  
  138.     Intl1Rec = PACKED RECORD
  139.         days:                    ARRAY [0..6] OF Str15;                    {day names}
  140.         months:                    ARRAY [0..11] OF Str15;                    {month names}
  141.         suppressDay:            UInt8;                                    {255 for no day, or flags to suppress any element}
  142.         lngDateFmt:                UInt8;                                    {order of long date elements}
  143.         dayLeading0:            UInt8;                                    {255 for leading 0 in day number}
  144.         abbrLen:                UInt8;                                    {length for abbreviating names}
  145.         st0:                    PACKED ARRAY [0..3] OF CHAR;            {separator strings for long date format}
  146.         st1:                    PACKED ARRAY [0..3] OF CHAR;
  147.         st2:                    PACKED ARRAY [0..3] OF CHAR;
  148.         st3:                    PACKED ARRAY [0..3] OF CHAR;
  149.         st4:                    PACKED ARRAY [0..3] OF CHAR;
  150.         intl1Vers:                INTEGER;                                {region code (hi byte) and version (lo byte)}
  151.         localRtn:                ARRAY [0..0] OF INTEGER;                {now a flag for opt extension}
  152.     END;
  153.     Intl1Ptr = ^Intl1Rec;
  154.     Intl1Hndl = ^Intl1Ptr;
  155.  
  156. {fields for optional itl1 extension}
  157.     Itl1ExtRec = RECORD
  158.         base:                    Intl1Rec;                                {un-extended Intl1Rec}
  159.         version:                INTEGER;
  160.         format:                    INTEGER;
  161.         calendarCode:            INTEGER;                                {calendar code for this itl1 resource}
  162.         extraDaysTableOffset:    LONGINT;                                {offset in itl1 to extra days table}
  163.         extraDaysTableLength:    LONGINT;                                {length of extra days table}
  164.         extraMonthsTableOffset:    LONGINT;                                {offset in itl1 to extra months table}
  165.         extraMonthsTableLength:    LONGINT;                                {length of extra months table}
  166.         abbrevDaysTableOffset:    LONGINT;                                {offset in itl1 to abbrev days table}
  167.         abbrevDaysTableLength:    LONGINT;                                {length of abbrev days table}
  168.         abbrevMonthsTableOffset: LONGINT;                                {offset in itl1 to abbrev months table}
  169.         abbrevMonthsTableLength: LONGINT;                                {length of abbrev months table}
  170.         extraSepsTableOffset:    LONGINT;                                {offset in itl1 to extra seps table}
  171.         extraSepsTableLength:    LONGINT;                                {length of extra seps table}
  172.         tables:                    ARRAY [0..0] OF INTEGER;                {now a flag for opt extension}
  173.     END;
  174.     UntokenTable = RECORD
  175.         len:                    INTEGER;
  176.         lastToken:                INTEGER;
  177.         index:                    ARRAY [0..255] OF INTEGER;                {index table; last = lastToken}
  178.     END;
  179.     UntokenTablePtr = ^UntokenTable;
  180.     UntokenTableHandle = ^UntokenTablePtr;
  181.  
  182.     WideChar = RECORD
  183.         CASE INTEGER OF
  184.         0: (
  185.             a:                            PACKED ARRAY [0..1] OF CHAR;        {0 is the high order character}
  186.            );
  187.         1: (
  188.             b:                            INTEGER;
  189.            );
  190.     END;
  191.     WideCharArr = RECORD
  192.         size:                    INTEGER;
  193.         data:                    ARRAY [0..9] OF WideChar;
  194.     END;
  195.     NumberParts = RECORD
  196.         version:                INTEGER;
  197.         data:                    PACKED ARRAY [0..30] OF WideChar;        {index by [tokLeftQuote..tokMaxSymbols]}
  198.         pePlus:                    WideCharArr;
  199.         peMinus:                WideCharArr;
  200.         peMinusPlus:            WideCharArr;
  201.         altNumTable:            WideCharArr;
  202.         reserved:                PACKED ARRAY [0..19] OF CHAR;
  203.     END;
  204.     NumberPartsPtr = ^NumberParts;
  205.  
  206.     Itl4Rec = RECORD
  207.         flags:                    INTEGER;                                {reserved}
  208.         resourceType:            LONGINT;                                {contains 'itl4'}
  209.         resourceNum:            INTEGER;                                {resource ID}
  210.         version:                INTEGER;                                {version number}
  211.         resHeader1:                LONGINT;                                {reserved}
  212.         resHeader2:                LONGINT;                                {reserved}
  213.         numTables:                INTEGER;                                {number of tables, one-based}
  214.         mapOffset:                LONGINT;                                {offset to table that maps byte to token}
  215.         strOffset:                LONGINT;                                {offset to routine that copies canonical string}
  216.         fetchOffset:            LONGINT;                                {offset to routine that gets next byte of character}
  217.         unTokenOffset:            LONGINT;                                {offset to table that maps token to canonical string}
  218.         defPartsOffset:            LONGINT;                                {offset to default number parts table}
  219.         resOffset6:                LONGINT;                                {reserved}
  220.         resOffset7:                LONGINT;                                {reserved}
  221.         resOffset8:                LONGINT;                                {reserved}
  222.     END;
  223.     Itl4Ptr = ^Itl4Rec;
  224.     Itl4Handle = ^Itl4Ptr;
  225.  
  226. { New NItl4Rec for System 7.0: }
  227.     NItl4Rec = RECORD
  228.         flags:                    INTEGER;                                {reserved}
  229.         resourceType:            LONGINT;                                {contains 'itl4'}
  230.         resourceNum:            INTEGER;                                {resource ID}
  231.         version:                INTEGER;                                {version number}
  232.         format:                    INTEGER;                                {format code}
  233.         resHeader:                INTEGER;                                {reserved}
  234.         resHeader2:                LONGINT;                                {reserved}
  235.         numTables:                INTEGER;                                {number of tables, one-based}
  236.         mapOffset:                LONGINT;                                {offset to table that maps byte to token}
  237.         strOffset:                LONGINT;                                {offset to routine that copies canonical string}
  238.         fetchOffset:            LONGINT;                                {offset to routine that gets next byte of character}
  239.         unTokenOffset:            LONGINT;                                {offset to table that maps token to canonical string}
  240.         defPartsOffset:            LONGINT;                                {offset to default number parts table}
  241.         whtSpListOffset:        LONGINT;                                {offset to white space code list}
  242.         resOffset7:                LONGINT;                                {reserved}
  243.         resOffset8:                LONGINT;                                {reserved}
  244.         resLength1:                INTEGER;                                {reserved}
  245.         resLength2:                INTEGER;                                {reserved}
  246.         resLength3:                INTEGER;                                {reserved}
  247.         unTokenLength:            INTEGER;                                {length of untoken table}
  248.         defPartsLength:            INTEGER;                                {length of default number parts table}
  249.         whtSpListLength:        INTEGER;                                {length of white space code list}
  250.         resLength7:                INTEGER;                                {reserved}
  251.         resLength8:                INTEGER;                                {reserved}
  252.     END;
  253.     NItl4Ptr = ^NItl4Rec;
  254.     NItl4Handle = ^NItl4Ptr;
  255.  
  256.     TableDirectoryRecord = RECORD
  257.         tableSignature:            OSType;                                    {4 byte long table name }
  258.         reserved:                LONGINT;                                {Reserved for internal use }
  259.         tableStartOffset:        LONGINT;                                {Table start offset in byte}
  260.         tableSize:                LONGINT;                                {Table size in byte}
  261.     END;
  262.     Itl5Record = RECORD
  263.         versionNumber:            Fixed;                                    {itl5 resource version number }
  264.         numberOfTables:            INTEGER;                                {Number of tables it contains }
  265.         reserved:                ARRAY [0..2] OF INTEGER;                {Reserved for internal use }
  266.         tableDirectory:            ARRAY [0..0] OF TableDirectoryRecord;    {Table directory records }
  267.     END;
  268.     RuleBasedTrslRecord = RECORD
  269.         sourceType:                INTEGER;                                {Transliterate target type for the LHS of the rule }
  270.         targetType:                INTEGER;                                {Transliterate target type for the RHS of the rule }
  271.         formatNumber:            INTEGER;                                {Transliterate resource format number }
  272.         propertyFlag:            INTEGER;                                {Transliterate property flags }
  273.         numberOfRules:            INTEGER;                                {Number of rules following this field }
  274.     END;
  275.     ItlcRecord = RECORD
  276.         itlcSystem:                INTEGER;                                {default system script}
  277.         itlcReserved:            INTEGER;                                {reserved}
  278.         itlcFontForce:            SInt8;                                    {default font force flag}
  279.         itlcIntlForce:            SInt8;                                    {default intl force flag}
  280.         itlcOldKybd:            SInt8;                                    {MacPlus intl keybd flag}
  281.         itlcFlags:                SInt8;                                    {general flags}
  282.         itlcIconOffset:            INTEGER;                                {keyboard icon offset; not used in 7.0}
  283.         itlcIconSide:            SInt8;                                    {keyboard icon side; not used in 7.0}
  284.         itlcIconRsvd:            SInt8;                                    {rsvd for other icon info}
  285.         itlcRegionCode:            INTEGER;                                {preferred verXxx code}
  286.         itlcSysFlags:            INTEGER;                                {flags for setting system globals}
  287.         itlcReserved4:            PACKED ARRAY [0..31] OF SInt8;            {for future use}
  288.     END;
  289.     ItlbRecord = RECORD
  290.         itlbNumber:                INTEGER;                                {itl0 id number}
  291.         itlbDate:                INTEGER;                                {itl1 id number}
  292.         itlbSort:                INTEGER;                                {itl2 id number}
  293.         itlbFlags:                INTEGER;                                {Script flags}
  294.         itlbToken:                INTEGER;                                {itl4 id number}
  295.         itlbEncoding:            INTEGER;                                {itl5 ID # (optional; char encoding)}
  296.         itlbLang:                INTEGER;                                {current language for script }
  297.         itlbNumRep:                SInt8;                                    {number representation code}
  298.         itlbDateRep:            SInt8;                                    {date representation code }
  299.         itlbKeys:                INTEGER;                                {KCHR id number}
  300.         itlbIcon:                INTEGER;                                {ID # of SICN or kcs#/kcs4/kcs8 suite.}
  301.     END;
  302. { New ItlbExtRecord structure for System 7.0 }
  303.     ItlbExtRecord = PACKED RECORD
  304.         base:                    ItlbRecord;                                {un-extended ItlbRecord}
  305.         itlbLocalSize:            LONGINT;                                {size of script's local record}
  306.         itlbMonoFond:            INTEGER;                                {default monospace FOND ID}
  307.         itlbMonoSize:            INTEGER;                                {default monospace font size}
  308.         itlbPrefFond:            INTEGER;                                {preferred FOND ID}
  309.         itlbPrefSize:            INTEGER;                                {preferred font size}
  310.         itlbSmallFond:            INTEGER;                                {default small FOND ID}
  311.         itlbSmallSize:            INTEGER;                                {default small font size}
  312.         itlbSysFond:            INTEGER;                                {default system FOND ID}
  313.         itlbSysSize:            INTEGER;                                {default system font size}
  314.         itlbAppFond:            INTEGER;                                {default application FOND ID}
  315.         itlbAppSize:            INTEGER;                                {default application font size}
  316.         itlbHelpFond:            INTEGER;                                {default Help Mgr FOND ID}
  317.         itlbHelpSize:            INTEGER;                                {default Help Mgr font size}
  318.         itlbValidStyles:        Style;                                    {set of valid styles for script}
  319.         itlbAliasStyle:            Style;                                    {style (set) to mark aliases}
  320.     END;
  321.  
  322. {$ALIGN RESET}
  323. {$POP}
  324.  
  325. {$SETC UsingIncludes := IntlResourcesIncludes}
  326.  
  327. {$ENDC} {__INTLRESOURCES__}
  328.  
  329. {$IFC NOT UsingIncludes}
  330.  END.
  331. {$ENDC}
  332.